<!doctype html>
<html ng-app="filesApp">
  <head>
    <script src="angular.min.js"></script>
    <script src="files.js"></script>
  </head>
  <body>
    <div ng-controller="FilesListController as filesList">
	    <h1>Files</h1>
	    
	    <section style="display: table; width: 80%">
		  <header style="display: table-row;">
		    <div style="display: table-cell;">Name</div>
		    <div style="display: table-cell;">Length</div>
		    <div style="display: table-cell;">createdDate</div>
		    <div style="display: table-cell;">Summary</div>
		  </header>
		  <div style="display: table-row;" ng-repeat="file in filesList.files">
		    <div style="display: table-cell;"><a href="{{filesList.getHref(file)}}" type={{file.mimeType}} download={{file.originalFilename}}>{{file.originalFilename}}</a></div>
		    <div style="display: table-cell;"><label>{{file.contentLength}}</label></div>
		    <div style="display: table-cell;"><label>{{file.createdDate}}</label></div>
		  </div>
		</section>
	    
	    <h2>New File</h2>
	    <input type="file" id="file" name="file"/>
		<button ng-click="filesList.upload()">Upload</button>
    </div>
  </body>
</html>
